package org.example.platform.design.celue;

public class Sum {
    static String[] arr = new String[]{"0.8", "1", "0.5", "0.85"};

    public static void main(String[] args) {
        double result = sum2(2, 3);


        // 增加打折
        for (String a : arr) {
            if(a.equals("0.8")){
                result = Math.round(result * 0.8);
            }
        }


        System.out.println(result);
    }

    public static double sum2(double dj, double num) {
        if (dj != 0.00 && num != 0.00) {
            return dj * num;
        }
        return 0.00;
    }
}
